<?php
class Item extends AppModel {

	var $name = 'Item';
	var $validate = array(
		'title' => array('notempty'),
		'short_description' => array('notempty'),
		'long_description' => array('notempty'),
		'condition_id' => array('notempty'),
		'expiration_date' => array('date'),
		'category_id' => array('notempty'),
		'user_id' => array('notempty')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Condition' => array(
			'className'  => 'Condition',
			'foreignKey' => 'condition_id',
			'conditions' => '',
			'fields'     => '',
			'order'      => ''
		),
		'Category' => array(
			'className'  => 'Category',
			'foreignKey' => 'category_id',
			'conditions' => '',
			'fields'     => '',
			'order'      => ''
		),
		'User' => array(
			'className'  => 'User',
			'foreignKey' => 'user_id',
			'conditions' => '',
			'fields'     => '',
			'order'      => ''
		)
	);

	var $hasMany = array(
		'Image' => array(
			'className'    => 'Image',
			'foreignKey'   => 'item_id',
			'dependent'    => false,
			'conditions'   => '',
			'fields'       => '',
			'order'        => '',
			'limit'        => '',
			'offset'       => '',
			'exclusive'    => '',
			'finderQuery'  => '',
			'counterQuery' => ''
		)
	);

}
?>